package fgoScript.entity.guda;

import commons.util.GameUtil;
import destinychild.entity.PointAndColor;
import fgoScript.constant.GameConstant;
import fgoScript.constant.PointInfo;
import fgoScript.entity.*;
import fgoScript.exception.AppNeedRestartException;
import fgoScript.exception.AppNeedStopException;
import fgoScript.service.CommonMethods;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;

public class TrainApGudazi extends AbstractApGudazi {
	private static final Logger LOGGER = LogManager.getLogger(TrainApGudazi.class);

	@Override
	public void intoAndSelect(int apNum, int acountNum) throws Exception {
		insertIntoTrainingRoom(apNum);
	}

	@Override
	public void fightAndStop(boolean rebootFlag, int apNum, int account) throws Exception {
		fightAndBack(apNum, account);
	}

	@Override
	public Point getSuppotServant() {
		return ServantSelect.getPoint();
	}

	@Override
	public void fightOverMethod() {
	}


	private void insertIntoTrainingRoom(int apNum) throws Exception {
		// 拉滚动条至最下上
		GameUtil.getMymouse().mouseMoveByPoint(PointInfo.getInstance().getpScrollRestDown(),true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
		GameUtil.getMymouse().mouseMoveByPoint(PointInfo.getInstance().getpScrollRestTop(),true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
		// 进入训练场
		// 周回进
		Point p4 = PointInfo.getInstance().getP_WEEK_ENTRANCE();
		GameUtil.getMymouse().mouseMoveByPoint(p4,true,true);

		GameUtil.getMymouse().mousePressAndReleaseForConfirm(null);
		
		GameUtil.delay(GameConstant.DELAY*5);
		
		// 拉滚动条至最下
		Point p16 = PointInfo.getInstance().getpScrollRestDown();
		GameUtil.getMymouse().mouseMoveByPoint(p16,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
		// 拖拽画面
		Point start = PointInfo.getInstance().getpDailySliceStrat();
		Point end = PointInfo.getInstance().getpDailySliceEnd();
		moveBySteps(start, end);

		// 点击日常
		Point p6 = PointInfo.getInstance().getpDailyEntrance();
		GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

		GameUtil.getMymouse().mousePressAndReleaseForConfirm(null);
		// 拉滚动条至最下
		GameUtil.getMymouse().mouseMoveByPoint(p16,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
		if(false){
            // 拉滚动条至中间
            Point p7 = PointInfo.getInstance().getpTrainAll();
			GameUtil.getMymouse().mouseMoveByPoint(p7,true,true);

			GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
            // 点击ap本
            Point p8 = PointInfo.getInstance().getTrainingRoom(apNum);
			GameUtil.getMymouse().mouseMoveByPoint(p8,true,true);

			GameUtil.getMymouse().mousePressAndReleaseForConfirm(null);
        }
        // 拖拽画面
        moveBySteps(start, end);
        moveBySteps(start, end);
        moveBySteps(start, end);
        // 点击点
        // 点击ap本
        Point p8 = PointInfo.getInstance().getTrainingRoom(apNum);
		GameUtil.getMymouse().mouseMoveByPoint(p8,true,true);

		GameUtil.getMymouse().mousePressAndReleaseForConfirm(null);
    }
	
	private void fightAndBack(int apNum, int account) throws Exception {
        // 获取战斗策略实例；
        BStrategy bs = BStrategy.getTrainStrategy(account);
        List<BServant> bServantList = bs.getbServants();
        List<Point> clothSkillPoints = bs.getClothSkillPoints();
        List<Point> changePersonPoints = bs.getChangePersonPoints();
        // 1回合数字高亮点
        List<BRound> bRoundList = bs.getbRounds();
        List<Point> fiveCardPoints = bs.getFiveCardPoints();
        int[][][] servantSkills = bs.getServantSkills();
        int[][][] afterClothSkills = bs.getAfterClothSkills();
        int[][][] clotheSkills = bs.getClotheSkills();
        int[][] npGos = bs.getNpGos();

        // 获取最大战斗次数；
        int eveValue;
        int battleRounds = 0;
        int MaxRounds = 20;
        int maxTurns = servantSkills.length;
        int skillSize;
        int cSkillSize;
        BServant fromServant;
        int fromSkillIndex;
        int toPersonIndex;
        PointColor pc;
        int rBcount;

        for (int i = 0; i < maxTurns; i++) {
            rBcount = 0;
            LOGGER.info("战斗等待");
            CommonMethods.waitToAttack(null, LOGGER);
            LOGGER.info("第"+ (i+1+"") +"回合开始");
            // 获取回合标识点集合；
            List<Point> pointList = bRoundList.get(i).getPhases();
            eveValue = GameUtil.getColorEveValue(pointList);
            while (eveValue > GameConstant.THRESHOLD && battleRounds < MaxRounds) {
                //前置判断是否到最后一回合
                pc = CommonMethods.waitToAttack(null, LOGGER);
                if ("attack".equals(pc.getName())) {
                }else {
                    LOGGER.info("羁绊点，跳出战斗！");
                    break;
                }
                if(rBcount++==0){
                    //执行从者技能
                    int[][] skills = servantSkills[i];
                    skillSize= skills.length;
                    for (int j = 0; j < skillSize; j++) {
                        // 等待
                        CommonMethods.waitToAttack(null, LOGGER);

                        fromServant = bServantList.get(skills[j][0]-1);
                        fromSkillIndex = skills[j][1]-1;
                        toPersonIndex = skills[j][2]-1;
						GameUtil.getMymouse().mouseMoveByPoint(fromServant.getSkLocs().get(fromSkillIndex),true,true);


						GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
                        // 选择人物
						GameUtil.getMymouse().mouseMoveByPoint(bServantList.get(toPersonIndex).getSetLoc(),true,true);

						GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
                        GameUtil.delay(1000);
                    }
                    //执行战斗服技能
                    int[][] cRSkills = clotheSkills[i];
                    int  cRSkillSize = cRSkills.length;

                    for (int j = 0; j < cRSkillSize; j++) {
                        // 等待
                        CommonMethods.waitToAttack(null, LOGGER);
                        //执行战斗服技能
                        fromSkillIndex = cRSkills[j][0]-1;
                        toPersonIndex = cRSkills[j][1]-1;
                        // 选择衣牌
						GameUtil.getMymouse().mouseMoveByPoint(clothSkillPoints.get(0),true,true);

						GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
                        // 选择衣牌技能
						GameUtil.getMymouse().mouseMoveByPoint(clothSkillPoints.get(fromSkillIndex+1),true,true);

						GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
                        if( cRSkills[j].length > 2){
                            // 选择交换人物1
							GameUtil.getMymouse().mouseMoveByPoint(changePersonPoints.get(cRSkills[j][1]-1),true,true);

							GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);

                            GameUtil.delay(1000);

                            // 选择交换人物2
							GameUtil.getMymouse().mouseMoveByPoint(changePersonPoints.get(cRSkills[j][2]-1),true,true);

							GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);

                            GameUtil.delay(1000);

                            // 确认
							GameUtil.getMymouse().mouseMoveByPoint(changePersonPoints.get(6),true,true);

							GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);

                        }else{
                            // 选择人物
							GameUtil.getMymouse().mouseMoveByPoint(bServantList.get(toPersonIndex).getSetLoc(),true,true);

							GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
                        }

                    }
                }
                //执行后置技能
                int[][] skills = afterClothSkills[i];
                skillSize= skills.length;
                for (int j = 0; j < skillSize; j++) {
                    // 等待
                    CommonMethods.waitToAttack(null, LOGGER);

                    fromServant = bServantList.get(skills[j][0]-1);
                    fromSkillIndex = skills[j][1]-1;
                    toPersonIndex = skills[j][2]-1;
					GameUtil.getMymouse().mouseMoveByPoint(fromServant.getSkLocs().get(fromSkillIndex),true,true);


					GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
                    // 选择人物
					GameUtil.getMymouse().mouseMoveByPoint(bServantList.get(toPersonIndex).getSetLoc(),true,true);

					GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
                    GameUtil.delay(1000);
                }
                // 等待
                CommonMethods.waitToAttack(null, LOGGER);
                // 蓝色圆板选择
                CommonMethods.blueAttackSelect();
                // 点击宝具
                int npSize;
                npSize = npGos[i].length;
                for (int k = 0; k < npSize; k++) {
					GameUtil.getMymouse().mouseMoveByPoint(bServantList.get(npGos[i][k]-1).getBjLoc(),true,true);

					GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/4);
                }
                // 点击5卡片
                int cardSize = fiveCardPoints.size();
                for (int j = 0; j < cardSize; j++) {
					GameUtil.getMymouse().mouseMoveByPoint(fiveCardPoints.get(j),true,true);

					GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
                }
                // 等待
                battleRounds++;
                CommonMethods.waitToAttack(i+"", LOGGER);
                GameUtil.delay(1000);
                eveValue = GameUtil.getColorEveValue(pointList);
            }
        }



//		int THRESHOLD = GameConstant.THRESHOLD;
//		// 1回合数字高亮点
//		List<PointAndColor> roundPcList = PointInfo.getInstance().getRound01();
//		int size = roundPcList.size();
//		List<Point> pointList = new ArrayList<>();
//		for (int i = 0; i < size; i++) {
//			pointList.add(roundPcList.get(i).getPoint());
//		}
//		int eveValue;
//		int battleRounds = 0;
//		int MaxRounds = 20;
//		// 第一回合
//		LOGGER.info("准备战斗，等待。。。。");
//		CommonMethods.waitToAttack(null, LOGGER);
//		LOGGER.info("第一回合开始：");
//		eveValue = GameUtil.getColorEveValue(pointList);
//		while (eveValue > THRESHOLD && battleRounds < MaxRounds) {
//			battleRounds++;
//			// 平A
//			attackAAA();
//			// 等待
//			CommonMethods.waitToAttack("1", LOGGER);
//			eveValue = GameUtil.getColorEveValue(pointList);
//		}
//		// 2回合数字高亮点
//		roundPcList = PointInfo.getInstance().getRound02();
//		size = roundPcList.size();
//		pointList = new ArrayList<>();
//		for (int i = 0; i < size; i++) {
//			pointList.add(roundPcList.get(i).getPoint());
//		}
//		int mCount = 0;
//		CommonMethods.waitToAttack(null, LOGGER);
//		LOGGER.info("第二回合开始：");
//		eveValue = GameUtil.getColorEveValue(pointList);
//		while (eveValue > THRESHOLD&& battleRounds < MaxRounds) {
//			battleRounds++;
//			// 选择第一个怪物
//			if (mCount == 0) {
//				Point pmm = new Point(124, 93);// 颜色：30;24;18 Color c = new Color(30, 24, 18);
//				GameUtil.mouseMoveByPoint(pmm);
//				GameUtil.mousePressAndRelease(KeyEvent.BUTTON1_DOWN_MASK);
//			}
//			// 加血
//			if (mCount == 1 && apNum > 30) {
//				battleSkill1();
//				CommonMethods.waitToAttack("2", LOGGER);
//			}
//			// 平A
//			attackAAA();
//			// 等待
//			CommonMethods.waitToAttack("2", LOGGER);
//			eveValue = GameUtil.getColorEveValue(pointList);
//			mCount++;
//		}
//
//		// 3回合数字高亮点
//		roundPcList = PointInfo.getInstance().getRound03();
//		size = roundPcList.size();
//		pointList = new ArrayList<>();
//		for (int i = 0; i < size; i++) {
//			pointList.add(roundPcList.get(i).getPoint());
//		}
//		// 第三回合
//		// 等待
//		CommonMethods.waitToAttack("3.1", LOGGER);
//		int bCount = 0;
//		LOGGER.info("第三回合开始：");
//		eveValue = GameUtil.getColorEveValue(pointList);
//		boolean isReDo = false;
//		while (eveValue > THRESHOLD&& battleRounds < MaxRounds) {
//			battleRounds++;
//			// 如果是羁绊结算就停止循环
//			if (checkFinish()) {
//				break;
//			}
//			// 宝具平A
//			isReDo = attackBAA(isReDo, apNum);
//			// 等待
//			CommonMethods.waitToAttack("3.2", LOGGER);
//			eveValue = GameUtil.getColorEveValue(pointList);
//			bCount++;
//		}
//		LOGGER.info("3链单循环战斗结束");
	}

	/**
	 * 平a攻击
	 * @throws AppNeedRestartException
	 */
	private void attackAAA() throws AppNeedRestartException, AppNeedStopException {
		// 蓝色圆板选择
		CommonMethods.blueAttackSelect();
        // 开始点击卡片
		List<Point> pList = getCommondCards();
		Point pTemp;
		// 大小大的攻击顺序
		pTemp = pList.get(4);
		GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		pTemp = pList.get(0);
		GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		pTemp = pList.get(3);
		GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		CommonMethods.checkExitCardSelect();
	}
	private List<Point> getCommondCards() {
		GameUtil.delay(GameConstant.DELAY*2);
		List<Point> p_supports = PointInfo.getInstance().getpSupports();
		Color color;
		Point point;
		PointColor pc;
		List<PointColor> pcList = new ArrayList<>();
		for (int i = 0; i < 5; i++) {
			point = p_supports.get(i);
			color = GameUtil.getScreenPixel(point);
			pc = new PointColor(point, color, true);
			pcList.add(pc);
		}
		pcList.sort((pc1, pc2) -> pc1.getColor().getRed() + pc1.getColor().getBlue() + pc1.getColor().getGreen()
				- pc2.getColor().getRed() - pc2.getColor().getBlue() - pc2.getColor().getGreen());
		List<Point> pList = new ArrayList<>();
		Point pTemp;
		int size = pcList.size();
		for (int i = 0; i < size; i++) {
			PointColor pointColor = pcList.get(i);
			pTemp = pointColor.getPoint();
			pTemp = new Point((int) pTemp.getX() - 80, (int) pTemp.getY() + 50);
			pList.add(pTemp);
		}
		return pList;
	}
	private void battleSkill1() throws Exception {
		// 等待
		CommonMethods.waitToAttack(null, LOGGER);

		Point p6 = new Point(906, 475);// 颜色：2;3;3 Color c = new Color(2, 3, 3);
		Point p7 = new Point(675, 474);// 颜色：254;238;211 Color c = new Color(254, 238, 211);
		// 战斗服选择
		Point p5 = new Point(1229, 359);// 颜色：24;60;107 Color c = new Color(24, 60, 107);
		GameUtil.getMymouse().mouseMoveByPoint(p5,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 选择技能1
		Point p8 = new Point(942, 362);// 颜色：157;224;193 Color c = new Color(157, 224, 193);
		GameUtil.getMymouse().mouseMoveByPoint(p8,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 选择人物
		GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		GameUtil.getMymouse().mouseMoveByPoint(p7,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
	}
	/**
	 * 宝具平a攻击
	 * 
	 * @throws Exception
	 */
	private boolean attackBAA(boolean isReDo, int apNum) throws Exception {
		Point pNp = new Point(182, 728);

		Color cNp = GameUtil.getScreenPixel(pNp);
		int c1 = cNp.getRGB();
		GameUtil.delay(GameConstant.DELAY);
		Color cNp2 = GameUtil.getScreenPixel(pNp);
		int c2 = cNp2.getRGB();

		LOGGER.info("有宝具吗？  " + (c1 != c2));
		if (c1 != c2) {
			// 等待
			if (!isReDo && apNum > 20) {
				// 等待
				CommonMethods.waitToAttack(null, LOGGER);
				// 战斗服技能
//				battleSkill23();
				// 等待
				CommonMethods.waitToAttack(null, LOGGER);
				// 技能1，2，3
				servantSkill();
				isReDo = true;
			}

			// 等待
			CommonMethods.waitToAttack(null, LOGGER);
			// 蓝色圆板选择
			CommonMethods.blueAttackSelect();
            // 开始点击卡片
			// 宝具
			Point p6 = new Point(428, 278);// 颜色：72;72;105 Color c = new Color(72, 72, 105);
			GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

			GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
			// 防止宝具冻结
			GameUtil.getMymouse().mouseMoveByPoint(PointInfo.getInstance().getDeadPoint(),true,true);

			GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

			List<Point> pList = getCommondCards();
			Point pTemp;
			// 大大的攻击顺序
			pTemp = pList.get(4);
			GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

			GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
			pTemp = pList.get(3);
			GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

			GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
			pTemp = pList.get(2);
			GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

			GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		} else {
			attackAAAC();
		}
		CommonMethods.checkExitCardSelect();
		return isReDo;
	}
	private void battleSkill23() throws Exception {
		// 等待
		CommonMethods.waitToAttack(null, LOGGER);

		Point p6 = new Point(906, 475);// 颜色：2;3;3 Color c = new Color(2, 3, 3);
		Point p7 = new Point(675, 474);// 颜色：254;238;211 Color c = new Color(254, 238, 211);
		// 战斗服选择
		Point p5 = new Point(1229, 359);// 颜色：24;60;107 Color c = new Color(24, 60, 107);
		GameUtil.getMymouse().mouseMoveByPoint(p5,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 选择技能2
		Point p8 = new Point(1029, 357);// 颜色：252;249;107 Color c = new Color(252, 249, 107);
		GameUtil.getMymouse().mouseMoveByPoint(p8,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 选择人物
		GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		GameUtil.getMymouse().mouseMoveByPoint(p7,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

		// 等待
		CommonMethods.waitToAttack(null, LOGGER);
		// 战斗服选择
		GameUtil.getMymouse().mouseMoveByPoint(p5,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 选择技能3
		Point p9 = new Point(1115, 360);// 颜色：69;71;111 Color c = new Color(69, 71, 111);
		GameUtil.getMymouse().mouseMoveByPoint(p9,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 选择人物
		GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		GameUtil.getMymouse().mouseMoveByPoint(p7,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
	}
	private void servantSkill() throws Exception {
		Point p2 = new Point(747, 632);// 颜色：91;91;91 Color c = new Color(91, 91, 91);
		GameUtil.getMymouse().mouseMoveByPoint(p2,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

		// 选择人物
		Point p6 = new Point(906, 475);// 颜色：2;3;3 Color c = new Color(2, 3, 3);
		GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		Point p7 = new Point(675, 474);// 颜色：254;238;211 Color c = new Color(254, 238, 211);
		GameUtil.getMymouse().mouseMoveByPoint(p7,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

		GameUtil.getMymouse().mouseMoveByPoint(PointInfo.getInstance().getDeadPoint(),true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 等待
		CommonMethods.waitToAttack(null, LOGGER);
		Point p3 = new Point(838, 625);// 颜色：121;65;79 Color c = new Color(121, 65, 79);
		GameUtil.getMymouse().mouseMoveByPoint(p3,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

		// 选择人物
		GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		GameUtil.getMymouse().mouseMoveByPoint(p7,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

		GameUtil.getMymouse().mouseMoveByPoint(PointInfo.getInstance().getDeadPoint(),true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		// 等待
		CommonMethods.waitToAttack(null, LOGGER);
		Point p4 = new Point(930, 627);
		GameUtil.getMymouse().mouseMoveByPoint(p4,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

		// 选择人物
		GameUtil.getMymouse().mouseMoveByPoint(p6,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		GameUtil.getMymouse().mouseMoveByPoint(p7,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);

		GameUtil.getMymouse().mouseMoveByPoint(PointInfo.getInstance().getDeadPoint(),true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
	}
	/**
	 * 平a攻击
	 * @throws AppNeedRestartException
	 */
	private void attackAAAC() throws AppNeedRestartException, AppNeedStopException {
		// 蓝色圆板选择
		CommonMethods.blueAttackSelect();
        // 开始点击卡片
		List<Point> pList = getCommondCards();
		Point pTemp;
		// 大小大的攻击顺序
		pTemp = pList.get(4);
		GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		pTemp = pList.get(3);
		GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		pTemp = pList.get(2);
		GameUtil.getMymouse().mouseMoveByPoint(pTemp,true,true);

		GameUtil.getMymouse().mousePressAndRelease(GameConstant.DELAY/6);
		CommonMethods.checkExitCardSelect();
	}

}
